<?php

class Social_Controller_Admin_Manage extends Controller
{
    public function actionIndex($request, $response)
    {
        $table = Agis::getTable('social@service');
        $select = $table -> select();

        $paginator = $this -> paginator = Zend_Paginator::factory($select);

        $paginator -> setCurrentPageNumber($request -> getParam('page', 1));
    }

    public function actionEdit($request, $response)
    {
        $service = $request -> getParam('service', 'facebook');

        $form = 'social@admin.settings.' . $service;

        $form = $response -> form = Agis::getForm($form);

        if ($request -> isPost() && $form -> isValid($_POST))
        {
            $form -> doCommit();
        }
    }

}
